package cn.sw.system.config.monitor;

import com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @Description: Nacos 注册中心监听器
 * @Author: 张众森
 * @Date: 2025/5/10
 */
@Component
public class NacosRegistrationLogger {

    @EventListener
    public void onInstanceRegistered(org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent event) {
        Object source = event.getSource();

        if (source instanceof NacosAutoServiceRegistration) {
            System.out.println("\n--------------- Nacos 注册成功 ---------------");
        }
    }
}
